Skip to main content

Introduction

What is the Document Framework?

The document framework is a set of programming tools helping to produce and transform data between different representations.

A single data can have multiple representation, each possible representation is related to a use of the data:

  • transfer on a network bitstream
  • programming on it with variable and method way
  • programming on it with flexible and less validated way
  • storage in a file
  • etc...

Why is it important ?

This framework provides a model and tools to handle different representation of the same data that will be useful depending on the use case.

For example, imagine a data of a person with a name and age.
Below you have exactly the same data, but with 4 different representations.

  • Object representation, used by programs:
class Person (aFullObject)
name: string
age: int4
end

var obj: Person
new(obj)
obj.name = 'john'
obj.age = 42
  • SQL representation, for SGBD storage:
INSERT INTO personTable (name, age)
VALUES ('john', '42')
  • Tree document representation:
doc.Map('name').SetCString('john')
doc.Map('age').SetCString('42')
  • String document representation, for web services/files:
{ 
"name": "john",
"age": 42
}

Where does it help ?

This framework is focused only on strongly encapsulated representation, these representations are named documents.

Framework

The data framework is declined into two parts:

  • Document representations:
    • aStringDocument: a unit describing a string representation with asynchronous streaming support
    • aDataDocument: a unit describing a data tree representation
  • Serialization model: provide way to transform object representation into data tree representation